#include "Clerk.h"

int Clerk::bonusPerOpenedAccount = 0;

Clerk::Clerk(const string firstName,const  string lastName, int age, eGender gender, int salary ,int numOfOpennedAccounts)
	: Employee(firstName, lastName, age, gender, salary), numOfOpennedAccounts(numOfOpennedAccounts)
{
}

Clerk::~Clerk()
{

}

int Clerk::getSalary()	const
{
	return Employee::getSalary() + getBonus();
}

void Clerk::toOs(ostream& os, bool isFullPrint) const
{
	os << "Clerk={Bonus=" << getBonus() << ", OpennedAccounts=" << numOfOpennedAccounts;
	if (isFullPrint)
	{
		os << "\n\t";
		Employee::toOs(os);
	}
	os << "}";
}

void Clerk::increaseOpennedAccounts()
{
	numOfOpennedAccounts++;
}
void Clerk::descreaseOpennedAccounts()
{
	numOfOpennedAccounts--;
}

int Clerk::getBonus() const
{
	return numOfOpennedAccounts + Clerk::bonusPerOpenedAccount;
}

void Clerk::updateBonusPerOppenedAccount(int bonus)
{
	Clerk::bonusPerOpenedAccount = bonus;
}

